﻿@page "/datagrid-multi-sort"

@using RadzenBlazorDemos.Data
@using RadzenBlazorDemos.Models.Northwind
@using Microsoft.EntityFrameworkCore

@inject NorthwindContext dbContext

<h1>DataGrid <strong>Multiple Column Sorting</strong></h1>

<RadzenExample Name="DataGridMultipleSort" Heading="false">
    <RadzenDataGrid PageSize="5" AllowMultiColumnSorting="true" AllowPaging="true" AllowSorting="true" Data="@employees" TItem="Employee" ColumnWidth="300px">
        <Columns>
            <RadzenDataGridColumn TItem="Employee" Property="FirstName" Title="First Name" />
            <RadzenDataGridColumn TItem="Employee" Property="LastName" Title="Last Name" Width="150px"/>
            <RadzenDataGridColumn TItem="Employee" Property="BirthDate" Title="Birth Date" FormatString="{0:d}" />
            <RadzenDataGridColumn TItem="Employee" Property="Country" Title="Country" />
            <RadzenDataGridColumn TItem="Employee" Property="Notes" Title="Notes" />
        </Columns>
    </RadzenDataGrid>
</RadzenExample>
@code {
    IEnumerable<Employee> employees;

    protected override void OnInitialized()
    {
        employees = dbContext.Employees;
    }
}